﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AppAcc.Views.FormDieuKien
{
    public partial class FormDieuKienSoTongHopNhapXuat : Form
    {
        public FormDieuKienSoTongHopNhapXuat()
        {
            InitializeComponent();
        }

        private void FormDieuKienSoTongHopNhapXuat_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dataSet_GetListTaiKhoan.GetListTaiKhoan' table. You can move, or remove it, as needed.
            this.getListTaiKhoanTableAdapter.Fill(this.dataSet_GetListTaiKhoan.GetListTaiKhoan);
            cbbX_TaiKhoan.DisplayMember = "Id";
            cbbX_TaiKhoan.ValueMember = "Id";
            cbbX_TaiKhoan.DropDownColumns = "Id,TenTaiKhoan";
            cbbX_TaiKhoan.DropDownColumnsHeaders = "Mã TK\r\nTên TK\r\n";
            //this.getlistTenTaiKhoanTableAdapter.Fill(this.dataSet_GetlistTenTaiKhoan.getlistTenTaiKhoan,cbbX_TaiKhoan.SelectedValue.ToString().Trim());
            GetTenTK();
        }

        private void cbbX_TaiKhoan_SelectedIndexChanged(object sender, EventArgs e)
        {
            GetTenTK();
           
        }
        void GetTenTK()
        {
            this.getlistTenTaiKhoanTableAdapter.Fill(this.dataSet_GetlistTenTaiKhoan.getlistTenTaiKhoan, cbbX_TaiKhoan.SelectedValue.ToString().Trim());
            cbbX_TenTaiKhoan.DisplayMember = "TenTaiKhoan";
            cbbX_TenTaiKhoan.ValueMember = "TenTaiKhoan";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Views.BaoCao.Form_BaoCaoTongHopNhapXuat f = new BaoCao.Form_BaoCaoTongHopNhapXuat(cbbX_TaiKhoan.SelectedValue.ToString(), dateTimePicker1.Value, dateTimePicker2.Value);
            f.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

     
    }
}
